/*
 * Filename:    HcpmsWFDAOImpl.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014年10月29日
 */
package com.paic.mhis.hcpms.common.workflow.intergration.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.common.workflow.dto.HcpmsWFConditionDTO;
import com.paic.mhis.hcpms.common.workflow.dto.HcpmsWFParamDTO;
import com.paic.mhis.hcpms.common.workflow.dto.HcpmsWFTaskDTO;
import com.paic.mhis.hcpms.common.workflow.dto.WorkFlowActinstDTO;
import com.paic.mhis.hcpms.common.workflow.dto.WorkFlowGtasksDTO;
import com.paic.mhis.hcpms.common.workflow.dto.WorkFlowTaskTypeDTO;
import com.paic.mhis.hcpms.common.workflow.dto.WorkFlowTransDTO;
import com.paic.mhis.hcpms.common.workflow.intergration.dao.HcpmsWFDAO;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("hcpmsWFDao")
public class HcpmsWFDAOImpl extends BaseDAO implements HcpmsWFDAO {

	@Override
	public void insertWorkFlowTask(HcpmsWFTaskDTO dto) {
		this._insert("workflow.insertWorkFlowTask", dto);
	}

	@Override
	public HcpmsWFTaskDTO getWorkFlowTask(HcpmsWFTaskDTO dto) {
		HcpmsWFTaskDTO resultDto = (HcpmsWFTaskDTO) this._queryForObject("workflow.queryWFTask", dto);
		return resultDto;
	}

	@Override
	public void updateWorkFlowTask(HcpmsWFTaskDTO dto) {
		this._update("workflow.updateWorkFlowTask", dto);
	}

	@Override
	public List<WorkFlowTransDTO> getTransList(WorkFlowTransDTO transDto) {
		List<WorkFlowTransDTO> list = (List<WorkFlowTransDTO>) this._queryForList("workflow.queryWFTrans", transDto);
		return list;
	}

	@Override
	public List<HcpmsWFConditionDTO> getConditionList(Map<String, Object> map) {
		List<HcpmsWFConditionDTO> list = (List<HcpmsWFConditionDTO>) this._queryForList("workflow.queryWFCondition",
				map);
		return list;
	}

	@Override
	public List<HcpmsWFParamDTO> getWFParamList(HcpmsWFTaskDTO dto) {
		List<HcpmsWFParamDTO> list = (List<HcpmsWFParamDTO>) this._queryForList("workflow.queryWFParam", dto);
		return list;
	}

	@Override
	public List<WorkFlowActinstDTO> getActinstList(String taskType) {
		// TODO Auto-generated method stub
		List<WorkFlowActinstDTO> list = (List<WorkFlowActinstDTO>) this._queryForList("workflow.queryWFActinst",
				taskType);
		return list;
	}

	@Override
	public List<WorkFlowGtasksDTO> getGtasksByAssigner(String assigner) {
		// TODO Auto-generated method stub
		List<WorkFlowGtasksDTO> list = (List<WorkFlowGtasksDTO>) this._queryForList("workflow.getGtasksByAssigner",
				assigner);
		return list;
	}

	@Override
	public List<WorkFlowGtasksDTO> getGtasksByGroup(String role) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<WorkFlowGtasksDTO> getOperatorTran(Map<String, Object> param) {
		// TODO Auto-generated method stub
		List<WorkFlowGtasksDTO> list = (List<WorkFlowGtasksDTO>) this._queryForList("workflow.getOperatorTran", param);
		return list;
	}

	@Override
	public List<WorkFlowTaskTypeDTO> getWFNoByTaskType(String taskType) {
		// TODO Auto-generated method stub
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("taskType", taskType);
		List<WorkFlowTaskTypeDTO> list = (List<WorkFlowTaskTypeDTO>) this._queryForList("workflow.querywftasktype",
				param);
		return list;
	}

	@Override
	public List<WorkFlowTransDTO> getActNext(Map<String, Object> param) {
		// TODO Auto-generated method stub
		List<WorkFlowTransDTO> list = (List<WorkFlowTransDTO>) this._queryForList("workflow.getActNext", param);
		return list;
	}

}
